const path =require("path");
const util =require("./build/util.js");
const htmlWebpackPlugin=require("html-webpack-plugin");

module.exports={
   mode:util.getMode(),
    entry:{
       main:'./src/main.js'
   },
   output:{
       path:path.resolve(__dirname,'dist'),
       filename:'js/[name].[hash].js',
       publicPath:'./'
   },
   devServer:{
       port:'8899'
   },
   resolve:{
       alias:{
           '@':path.resolve(__dirname,'./src')
       },
       extensions:['.js','.vue','.json','.css','.less'],
       modules:["node_modules"]
   },
   externals:{
       'Vue':'window.Vue'
   },
   plugins:[
       new htmlWebpackPlugin({
           filename:'index.html',
           template:'./index.html',
           inject:true,
       })
   ]

}